﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/loggedin.Master" AutoEventWireup="true" CodeBehind="widget_setup.aspx.cs" Inherits="Ciripescu_WebRole.widget_setup" EnableEventValidation="false" ValidateRequest="false"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
.ciripescu-title 
{
    margin:0;
    padding:0;
    color:#333333;
}
#ciripescu_div 
{
    font-family:'Lucida Grande',sans-serif;
    font-size:0.75em;
}
#ciripescu_div a, #ciripescu_div a:visited
{
    color:Blue;
    text-decoration:none;
}

#ciripescu_div a:hover
{    
    text-decoration:underline;
    color:Black;
}

#ciripescu_div ul, #ciripescu_div li
{    
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none; 
    margin:0;   
    padding:0;
}

#ciripescu_div  li
{    
    margin-bottom:5px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                    var nr_div = document.getElementById('ctl00_ContentPlaceHolder1_nr');
                    if (!nr_div) nr_div = ctl00_ContentPlaceHolder1_nr;
                    var nr = nr_div.innerHTML;
                    if (nr == "1") ruleaza_script_Ciripescu1();
                    if (nr == "2") ruleaza_script_Ciripescu2();
                    if (nr=="3") ruleaza_script_Ciripescu3();
                    if (nr=="4") ruleaza_script_Ciripescu4();
                    if (nr=="5") ruleaza_script_Ciripescu5();
                    if (nr=="6") ruleaza_script_Ciripescu6();
                    if (nr=="7") ruleaza_script_Ciripescu7();
                    if (nr=="8") ruleaza_script_Ciripescu8();
                    if (nr=="9") ruleaza_script_Ciripescu9();
                    if (nr=="10") ruleaza_script_Ciripescu10();
                    if (nr=="11") ruleaza_script_Ciripescu11();
                    if (nr=="12") ruleaza_script_Ciripescu12();
                    if (nr=="13") ruleaza_script_Ciripescu13();
                    if (nr == "13") ruleaza_script_Ciripescu13();
                    if (nr=="14") ruleaza_script_Ciripescu14();
                    if (nr=="15") ruleaza_script_Ciripescu15();
                    if (nr=="16") ruleaza_script_Ciripescu16();
                    if (nr=="17") ruleaza_script_Ciripescu17();
                    if (nr == "18") ruleaza_script_Ciripescu18();
                    if (nr == "19") ruleaza_script_Ciripescu19();
                    if (nr == "20") ruleaza_script_Ciripescu20();
                    
                    
                }
            </script>
    <table width="100%">
    <tr>
        <td width="50%" valign="top">
            <table width="100%">
                <tr>
                    <td width="70px"></td>
                    <td></td>
                </tr>
                <tr>
                    <td class="label_small">Numarul de ciripuri:</td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlNrCiripuri" runat="server" AutoPostBack="True"  CssClass="textbox"
                                    onselectedindexchanged="btnGenereaza_Click">
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem Selected="True">5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem>7</asp:ListItem>
                                    <asp:ListItem>8</asp:ListItem>
                                    <asp:ListItem>9</asp:ListItem>
                                    <asp:ListItem>10</asp:ListItem>
                                    <asp:ListItem>11</asp:ListItem>
                                    <asp:ListItem>12</asp:ListItem>
                                    <asp:ListItem>13</asp:ListItem>
                                    <asp:ListItem>14</asp:ListItem>
                                    <asp:ListItem>15</asp:ListItem>
                                    <asp:ListItem>16</asp:ListItem>
                                    <asp:ListItem>17</asp:ListItem>
                                    <asp:ListItem>18</asp:ListItem>
                                    <asp:ListItem>19</asp:ListItem>
                                    <asp:ListItem>20</asp:ListItem>
                               </asp:DropDownList>
                               <div id="nr" runat="server" style="display:none;"></div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                     </td>
                </tr>
                <tr>
                    <td class="label_small">Titlu:</td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtTitlu" runat="server" AutoPostBack="True" CssClass="textbox" 
                                    ontextchanged="btnGenereaza_Click">Ciripuri de pe Ciripescu</asp:TextBox>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:CheckBox ID="chkTitlu" runat="server" AutoPostBack="True" 
                                Text="Fara titlu" CssClass="label_small" oncheckedchanged="btnGenereaza_Click" />
                        </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <noscript>
                            <asp:Button ID="btnGenereaza" runat="server" Text="Genereaza" onclick="btnGenereaza_Click" />
                        </noscript>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                    <br />
                        <h3>Cod HTML:</h3>
                        Faceti copy&amp;paste la urmatorul cod HTML la voi pe site:<br /><br />
                        <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                            <ContentTemplate>
                                <asp:TextBox ID="txtCopyPaste" runat="server" Width="100%" Height="185px" 
                            TextMode="MultiLine"></asp:TextBox>    
                            </ContentTemplate>
                        </asp:UpdatePanel>
                                                
                        <br /><br />
                        <h3>Cod CSS:</h3>
                        Pentru formatare (schimbare de culori/stil/etc) puteti folosi urmatorul cod CSS. Evident recomandam sa-l modificati dupa cum va place sa se potriveasca cu site vostru:                        
                        <br /><br />
                        <asp:TextBox ID="txtCSS" runat="server" Width="100%" Height="185px" 
                            TextMode="MultiLine">
.ciripescu-title 
{
    margin:0;
    padding:0;
    color:#333333;
}
#ciripescu_div 
{
    font-family:'Lucida Grande',sans-serif;
    font-size:0.75em;
}
#ciripescu_div a, #ciripescu_div a:visited
{
    color:Blue;
    text-decoration:none;
}

#ciripescu_div a:hover
{    
    text-decoration:underline;
    color:Black;
}

#ciripescu_div ul, #ciripescu_div li
{    
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none; 
    margin:0;   
    padding:0;
}

#ciripescu_div  li
{    
    margin-bottom:5px;
}
                            </asp:TextBox>  
                    </td>
                </tr>
            </table>
        </td>
        <td valign="top">
            <span class="label_small">Preview:</span><br />
            <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                <ContentTemplate>
                    <div id='Preview' runat="server"></div>
                </ContentTemplate>
            </asp:UpdatePanel>
            <!-- din cauza ca nu se poate la runtime din ajax codul unei functii javascript singura solutie pentru
                 a putea schimba repede din dropdown a numarului de ciripuri fara full postback e asta: -->
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/1/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/2/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/3/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/4/widget.js' type="text/javascript"></script>            
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/6/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/7/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/8/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/9/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/10/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/11/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/12/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/13/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/14/widget.js' type="text/javascript"></script>            
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/15/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/16/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/17/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/18/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/19/widget.js' type="text/javascript"></script>
            <script src='http://www.ciripescu.ro/<%=(string)Session["UserName"] %>/20/widget.js' type="text/javascript"></script>
            
            
        </td>
   </tr>
</table>
</asp:Content>
